<template>
  <h1>正中登录中...</h1>
</template>

<script>
export default {
  created() {
    // 监听登录状态的变化
    this.$store.watch(
      () => this.$store.getters["loginUser/status"],
      (status) => {
        if (status !== "loading") {
          this.$router
            .push(this.$route.query.returnUrl || "/home")
            .catch(() => {});
        }
      },
      {
        immediate: true, // 立即执行
      }
    );
  },
};
</script>

<style>
</style>